﻿Ext.define('app.system.project_role.Index',
{
    extend: 'Ext.grid.Panel',
    border: true,
    title: '项目角色',
    // tbar: [],
    //controller: 'substance',
    //viewModel: {
    //    type: 'compoundModel'
    //},
    //requires: ['app.system.substance.SubstanceController'],
    viewConfig: {
        enableTextSelection: true //可以复制单元格文字
    },
    multiColumnSort: true,
    forceFit: true,
    initComponent: function () {
        var me = this;
        me.items = [];
        me.tbar = [
            {
                text: '新增', iconCls: "add", handler: function () {
                    var win = Ext.create("app.system.project_role.Edit", { title: '新增角色' });
                    win.on("savesuccess", function ()
                    {
                        me.store.load();
                        win.close();
                    });
                    win.show();
                }
            }
            //{
            //    text: '编辑', iconCls: "edit", bind: { disabled: '{btnHidden}' }, handler: 'onEdit'
            //},
            //{
            //    text: '删除', iconCls: "delete", bind: { disabled: '{btnHidden}' }, handler: 'onRemove'
            //},
            //"->",
            //{
            //    text: '查询', iconCls: "search", menu: {
            //        xtype: 'menu',
            //        plain: true,
            //        items: me.searchPanel
            //    }
            //}
        ];
        me.store = Ext.create("app.ux.PrmStore", { url: '/api/services/app/projectRole/GetAll' });
        me.callParent(arguments);
    },
    columns: [
        { header: "角色名称", dataIndex: 'roleName' },
        { header: "排序", dataIndex: 'sortfactor' },
        //{ header: "内置关联角色", dataIndex: 'internalRole' },
        { header: "是否系统保留角色", dataIndex: 'isReserved' },
        { header: "是否参与人力计划", dataIndex: 'isHumanWork' },
        { header: "描述", dataIndex: 'description' },
    ]
});
